package demo;
interface StartStop {
    void start();
    void stop();
}
class Conference implements StartStop {
    public void start() {
        System.out.println("开始会议");
    }
    public void stop() {
        System.out.println("结束会议");
    }
}
class Car implements StartStop {
    public void start() {
        System.out.println("启动汽车");
    }
    public void stop() {
        System.out.println("停止汽车");
    }
}
public class demo04 {
    public static void main(String[] args) {
        //接口不能创建实例，但是可以定义引用变量指向子类对象
        StartStop[] objects = {new Conference(), new Car()};
        for (StartStop obj : objects) {
            obj.start();
            obj.stop();
        }
    }
}
